﻿
using System;
using System.Collections.ObjectModel;
using System.Linq;

using OpenCvSharp;

using Xc.DataAccess.CodeReader.Properties;
using Xc.DataAccess.Core;

namespace Xc.DataAccess.CodeReader.Models.Filters
{
    /// <summary>
    /// 计算俩张图片的差异
    /// </summary>
    [Filter("计算不同", FilterType.Algorithm)]
    public class AlgorithmAbsdiff : FilterBase
    {
        /// <summary>
        /// 输入图像
        /// </summary>
        [InputParameter("输入图像")]
        public Mat InputImage { get; set; }
        internal override ResultData<Mat> UseChannel(Mat mat, FilterBase[] filterInfos, FilterBase preFilterBase)
        {
            Mat mat1 = new Mat();
            Cv2.Absdiff(mat, InputImage,mat1);
            return ResultData<Mat>.Accept(TextResource.filter_action_complete, mat1);
        }
    }

}
